{% extends "nav.html" %}
{% block little %}存储需求信息{% endblock %}
{% block content %}
    <!-- Main Content -->
    <div class="container-fluid">
        <div class="side-body">

        </div>
    </div>
{% endblock %}
{% block js %}
    <div>
        <div class="modal fade bs-example-modal-lg work_motai" tabindex="-1">
            <div class="modal-dialog modal-lg" role="document" style="width: auto">
                <div class="modal-content">
                    <p id="work_show"></p>
                </div>
            </div>
        </div>
    </div>

    <div>
        <div class="modal fade work_edit" tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel" id="work_edit">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title" id="gridSystemModalLabel">修  改</h4>
                    </div>

                    <div class="modal-body ">

                        <div class="row">
                            <div>
                                <div class="col-md-4"><h5>基本需求：</h5></div>
                                <div class="col-md-4"><h5>需求部门：</h5></div>
                                <div class="col-md-4"><h5>负责人：</h5></div>
                            </div>
                            <div>
                                <div class="col-md-4"><input type="text" class="form-control WO_time" id="xuqiushijian" placeholder="需求时间"></div>
                                <div class="col-md-4 "><input type="text" class="form-control" id="WO_department" placeholder="需求部门"></div>
                                <div class="col-md-4 "><input type="text" class="form-control" id="WO_people" placeholder="负责人"></div>a
                            </div>
                        </div>
                        <div class="row ">
                            <div>
                                <div class="col-md-4"><h5>存储：</h5></div>
                                <div class="col-md-4"><h5>容量：</h5></div>
                                <div class="col-md-4"><h5>容量说明：</h5></div>
                            </div>
                            <div>
                                <div class="col-md-4 "><input type="text" class="form-control" id="WO_storage" placeholder="存储"></div>
                                <div class="col-md-4 "><input type="text" class="form-control" id="WO_CAP" placeholder="容量"></div>
                                <div class="col-md-4 "><input type="text" class="form-control" id="WO_CAPname" placeholder="容量说明"></div>
                            </div>
                        </div>
                        <div class="row page-header">
                            <div>
                                <div class="col-md-8 "><h5>业务名称：</h5></div>
                                <div class="col-md-4"><h5>结束时间：</h5></div>
                            </div>
                            <div>
                                <div class="col-md-8 "><input type="text" class="form-control" id="WO_textname" placeholder="业务名称"></div>
                                <div class="col-md-4 "><input type="text" class="form-control" id="jiesushijian" placeholder="结束时间"></div>
                            </div>
                        </div>
                        <div class="row ">
                            <div style="margin-left: 15px"><h5>需求说明：</h5></div>
                            <div class="col-md-12"><input type="text" class="form-control" id="WO_text" placeholder="需求说明"></div>
                        </div>
                        <div class="row ">
                            <div style="margin-left: 15px"><h5>详细说明：</h5></div>
                            <div class="col-md-12">
                                <textarea id="editor_id" name="content" style="width:auto;height:200px;"></textarea>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">关  闭</button>
                        <button type="button" class="btn btn-primary">保  存</button>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div><!-- /.modal -->
    </div>
    <script charset="utf-8" src="/static/js/kindeditor-all-min.js"></script>
    <script charset="utf-8" src="/static/js/lang/zh-CN.js"></script>
    <script charset="utf-8" src="/static/js/laydate/laydate.js"></script>
    <script>
        $(".st_sel_update") .click(function () {
            $("#work_edit").modal({backdrop: 'static', keyboard: false},'toggle')
            $("#gridSystemModalLabel").text("修改中")
            var id = $(this).attr("nid")
            $.ajax({
                url: "{% url "work_upadte_ajax" %}",
                type: 'POST',
                data:{"id":id},
                success: function(data){
                    var obj = JSON.parse(data);
                    {#                    var obj = data;#}
                    if(obj.status){
                        $("#xuqiushijian").val(obj.WO_time)
                        $("#WO_department").val(obj.WO_department)
                        $("#WO_text").val(obj.WO_text)
                        $("#WO_CAP").val(obj.WO_CAP)
                        $("#WO_CAPname").val(obj.WO_CAPname)
                        $("#WO_textname").val(obj.WO_textname)
                        $("#WO_people").val(obj.WO_people)
                        $("#WO_storage").val(obj.WO_storage)
                        $("#jiesushijian").val(obj.WO_fishtime)
                        $("#editor_id").val(obj.WO_note)
                    }else{
                    };
                }
            });
        });

        $(".work_select").click(function () {
            $(".work_motai").modal( 'toggle')
            var nid = $(this).attr("nid")
            $.ajax({
                url: "{% url "work_work_ajax" %}",
                type: 'POST',
                data:{"id":nid},
                success: function(data){
                    var obj = JSON.parse(data);
                    if(obj.status){
                        $("#work_show").html(obj.data)
                        $("#work_show").children().addClass("table table-bordered table-condensed")
                    }else{
                        $("#storge_err").text("更新失败：" + obj.error);
                        $("storage_jindutiao").hide();
                        $("#storage_close").show();
                    };
                }
            });
        });
    </script>
    <script>
        var editor;
        KindEditor.ready(function(K) {
            window.editor = K.create('#editor_id');
        });


        laydate.render({
            elem: '#xuqiushijian' //指定元素
            ,type: 'datetime'
        });

        laydate.render({
            elem: '#jiesushijian' //指定元素
            ,type: 'datetime'
        });
    </script>
{% endblock %}
